/**
 * Created by abiu on 2016-03-30.
 */
var co = function(fn){
    var gen = fn.call();
    if(!gen.next)
        throw "co need generator function !"

  return next();
    function next(data){
        var res = gen.next(data);
        if(res.done)
            return res.value;
        if(isPromise(res.value)){
            return res.value.then(function(data){
                next(data);
            })
        }
        if(isFunction(res)){

        }
    }
}